package com.yer.note.activity.ui;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.yer.note.R;
import com.yer.note.activity.setting_Username;
import com.yer.note.activity.setting_motto;
import com.yer.note.activity.setting_password;

public class SettingFragment extends Fragment {
    View root;
    TextView modifyUsername;
    TextView modifyPassword;
    TextView modifyMotto;
    public void initView(){
        modifyPassword = root.findViewById(R.id.modifyPassword);
        modifyUsername = root.findViewById(R.id.modifyUsername);
        modifyMotto = root.findViewById(R.id.modifyMotto);
        modifyPassword.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), setting_password.class);
                startActivity(intent);
            }
        });
        modifyUsername.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), setting_Username.class);
                startActivity(intent);
            }
        });
        modifyMotto.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(getActivity(), setting_motto.class);
                startActivity(intent);
            }
        });
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        if (root == null){
            //获得布局文件
            root = inflater.inflate((R.layout.fragment_setting),container, false);

        }
        initView();
        return  root;
    }
}